package com.homedo.microservice.open.service.gateway.manager.web.gateway.bean.enums.foralertnotice;

/**
 * @author 作者 jgshun
 * @date 创建时间 2018年10月16日 16时44分30秒
 */
public enum StatusEnum4AlertNotice {
    /**
     * (short) 1, "可用"
     */
    EFFECTIVE((short) 1, "可用"),
    /**
     * (short) 0, "不可用"
     */
    INVALID((short) 0, "不可用"),
    /**
     * (short) 2, "结束"
     */
    FINISH((short) 2, "结束");

    private short code;
    private String msg;

    private StatusEnum4AlertNotice(short code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public short getCode() {
        return code;
    }

    public void setCode(short code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }


    public static StatusEnum4AlertNotice getStatusEnumByCode(short code) {
        for (StatusEnum4AlertNotice _enum : StatusEnum4AlertNotice.values()) {
            if (_enum.getCode() == code) {
                return _enum;
            }
        }
        return null;
    }
}
